{layout name='admin/layout' /}

<style>
    label, .lbl{
        vertical-align: baseline;
    }
</style>
<div class="col-xs-12">
    <div class="page-header">
        <h1>{:v('headtitle')}</h1>
    </div>
    <form class="form-horizontal" id="form" onsubmit="false" action="{:url('update')}">
        <div class="form-group">
            <label class="col-sm-3 control-label no-padding-right"> 链接地址 </label>
            <div class="col-sm-2">
                <select name="pid" class="form-control" id="form-field-select-1">
                    <option value="{$res.pid}">{$res.title}</option>
                    {volist name='select' id='v'}
                        <option value="{$v.id}">{$v.title}</option>
                        {present name='v.children'}
                            {volist name='v.children' id='vv'}
                                <option value="{$vv.id}">┗━{$vv.title}</option>
                                {present name='vv.children'}
                                    {volist name='vv.children' id='vvv'}
                                        <option value="{$vvv.id}">&nbsp;&nbsp;&nbsp;┗━{$vvv.title}</option>
                                    {/volist}
                                {/present}
                            {/volist}
                        {/present}
                    {/volist}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 标题 </label>

            <div class="col-sm-9">
                <input type="text" name="title" id="form-field-1" class="col-xs-10 col-sm-5" value="{$res.title}" data-rule="*" data-errmsg="栏目标题不可为空"/>
                <span class="help-inline col-xs-12 col-sm-7">
                <span class="middle">标题不可为空</span>
            </div>
        </div>

        <div class="space-4"></div>

        <div class="form-group">
            <label class="col-sm-3 control-label no-padding-right" for="form-field-2"> 图标 </label>

            <div class="col-sm-9">
                <input type="text" name="icon" id="form-field-2" class="col-xs-10 col-sm-5" value="{$res.icon}"/>
            </span>
            </div>
        </div>

        <div class="space-4"></div>

        <div class="form-group">
            <label class="col-sm-3 control-label no-padding-right"> 链接地址 </label>

            <div class="col-sm-9">
                <input type="text" name="url" class="col-xs-10 col-sm-5" placeholder="格式如：Index/index" value="{$res.url}"/>
                <span class="help-inline col-xs-12 col-sm-7">
                <span class="lbl"> Disable it!</span>
            </span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label no-padding-right"> 排序 </label>

            <div class="col-sm-9">
                <input type="number" name="sort" class="col-xs-10 col-sm-5"  value="{$res.sort}"/>
                <span class="help-inline col-xs-12 col-sm-7">
                <span class="lbl"> 越小越前</span>
            </span>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label no-padding-right"> 是否显示 </label>

            <div class="col-sm-9">
                <label>
                    <input name="display" {eq name='res.display' value='1'}checked="checked"{/eq} class="ace ace-switch ace-switch-5" type="checkbox" value="1">
                    <span class="lbl"></span>
                </label>
                </span>
            </div>
        </div>

        <!-----------------id------------------>
        <input type="hidden" name="id" value="{$res.id}" />
        <!-----------------id------------------>

        <div class="col-md-offset-3 col-md-9">
            <button class="btn btn-info" type="button" id="submit">
                <i class="icon-ok bigger-110"></i>
                修改
            </button>

            <button class="btn" type="reset">
                <i class="icon-undo bigger-110"></i>
                清空
            </button>
        </div>
    </form>
</div>